<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DOM学习</title>
</head>
<body>
<h1>我是标题</h1>
<button type="button" onclick="f()">按钮</button>
</body>
<!--文档 对象模型数据-->
<script>
  function f() {
    var h1 = document.querySelector("h1");
    console.log(h1)
    var hv= h1.innerHTML;
    console.log(hv)
    //
    h1.innerHTML = "我是修改后的标题";
  }
</script>
</html>